約 1,824,639 件
https://w.atwiki.jp/idjj/pages/19.html
concurrent
https://w.atwiki.jp/sami1127/pages/26.html
Struts2 struts.xmlのresult-typesでエラー Tiles
https://w.atwiki.jp/ce00582/pages/1107.html
class prob{ double[] ex(){ double p; double mu; double sig; double yy; double th[]= new double[101]; int s; mu=0; sig=0.39; for (s=1;s 101;s++){ p=0.01*s-0.005; yy=seeky(p,mu,sig); th[s]=Math.exp(yy); } return th; } static double f(double x,double mu,double sig){ double pi,x1,x2,x3,fx; pi = 3.1415; x1=-Math.pow(x - mu,2) / (2*Math.pow(sig,2)); x2=Math.exp(x1); x3=sig*Math.pow(2*pi,0.5); fx=x2/x3; return fx; } static double g(double y,double mu, double sig){ double gx,h,x; int n,t; gx=0; h=0.001; t=(int)(y/h); for (n=-2000;n t;n++){ x=n*h; gx=gx+f(x,mu,sig)*h; } return gx; } static double seeky(double p,double mu,double sig){ double g1,g2,y1,y2,y3; int t; y1=0.4; y2=-0.2; g1=g(y1,mu,sig); t=0; while(t 100){ g2=g(y2,mu,sig); y3=y2+(p-g2)*(y2-y1)/(g2-g1); y1=y2; y2=y3; g1=g2; if (Math.pow(p-g2,2) 0.0001)t=1000; t=t+1; } return y2; } } class linear{ double[] ex(){ double th[]= new double[101]; int s; double tl; double tr; double ls; double w; double cs; double ys; double b1; double b2; double tr1; double tr2; double tr3; double wel; double maxwel; double maxtl; double maxtr; int t; int n; double h; double c[]= new double[101]; double y[]= new double[101]; double data[]=new double[201]; int n1; int n2; prob tai =new prob(); th=tai.ex(); maxwel=-999; maxtr=0; maxtl=0; for (n=20;n 45;n++){ tl=0.01*n; tr1=0.01; tr2=0.02; tr=tr1; b1=bud(tl,tr1,th); t=0; while (t 100) { b2=bud(tl,tr2,th); tr3=tr2-b2*(tr2-tr1)/(b2-b1); tr1=tr2; tr2=tr3; b1=b2; if (b2*b2 0.00001)t=1000; t=t+1; } tr=tr2; wel=seekwel(tl,tr,th); if (wel maxwel)maxtl=tl; if (wel maxwel)maxtr=tr; if (wel maxwel)maxwel=wel; } tl=maxtl; tr=maxtr; for (s=1;s 101;s++){ w=(1-tl)*th[s]; ls=(w-tr)/(2*w); if (ls 0)ls=0; c[s]=w*ls+tr; y[s]=th[s]*ls; } for (s=1;s 101;s++){ data[s]=c[s]; data[s+100]=y[s]; } return data; } static double ux(double c1,double l1){ double u1; double c3; double l3; int pp; pp=0; c3=c1; l3=l1; if (c3 0)pp=100; if (l3 0)pp=100; if (l3 1)pp=100; if (pp 50)c3=0.5; if (pp 50)l3=0.5; u1=Math.log(c3)+Math.log(1-l3); if (pp 50)u1=-999; return u1; } static double bud(double tl,double tr,double th[]){ double bx; int s; double w; double y1; double c1; double l1; bx=0; for (s=1;s 101;s++){ w=(1-tl)*th[s]; l1=(w-tr)/(2*w); if (l1 0)l1=0; y1=th[s]*l1; c1=w*l1+tr; bx=bx+y1-c1; } return bx; } static double seekwel(double tl,double tr,double th[]){ double sw; int s; double w; double l1; double c1; sw=0; for (s=1;s 101;s++){ w=(1-tl)*th[s]; l1=(w-tr)/(2*w); if (l1 0)l1=0; c1=w*l1+tr; sw=sw+ux(c1,l1); } return sw; } } class tax{ public static void main(String args[]){ double th[]= new double[101]; double c[]= new double[101]; double y[]= new double[101]; int opc[]= new int[101]; int opy[]= new int[101]; int opq[]= new int[101]; double u[][][]=new double[101][3][3]; double ww[][][]=new double[100][3][3]; double v[][][][]=new double[100][3][3][21]; int gotoc[][][][]=new int[100][3][3][21]; int gotoy[][][][]=new int[100][3][3][21]; int gotoq[][][][]=new int[100][3][3][21]; double endv[][]=new double[3][3]; int endc[][]=new int[3][3]; int endy[][]=new int[3][3]; int endq[][]=new int[3][3]; int s; double tl; double tr; double ls; double w; double cs; double ys; double b1; double b2; double tr1; double tr2; double tr3; double wel; double maxwel; double maxtl; double maxtr; int t; int n; int n1; int n2; int pp; int q; int j; double c1; double l1; double h; double u1; int ns1; int ns2; int qx; int nx1; int nx2; double vs; double v1; double maxv; double dc; double dy; int e; double data[]=new double[201]; prob tai =new prob(); th=tai.ex(); linear tool=new linear(); data=tool.ex(); for (s=1;s 101;s++){ c[s]=data[s]; y[s]=data[s+100]; } h=0.001; t=0; while(t 1000){ for (s=1;s 101;s++){ for (n1=-1;n1 2;n1++){ for (n2=-1;n2 2;n2++){ c1=c[s]+n1*h; l1=(y[s]+n2*h)/th[s]; u1=ux(c1,l1); u[s][n1+1][n2+1]=u1; } } } for (s=1;s 100;s++){ for (n1=-1;n1 2;n1++){ for (n2=-1;n2 2;n2++){ c1=c[s]+n1*h; l1=(y[s]+n2*h)/th[s+1]; u1=ux(c1,l1); ww[s][n1+1][n2+1]=u1; } } } for (n1=-1;n1 2;n1++){ for (n2=-1;n2 2;n2++){ for (q=-10;q 11;q++){ v[1][n1+1][n2+1][q+10]=-999; } } } for (n1=-1;n1 2;n1++){ for (n2=-1;n2 2;n2++){ q=n2-n1; v[1][n1+1][n2+1][q+10]=u[1][n1+1][n2+1]; } } for (s=2;s 100;s++){ for (n1=-1;n1 2;n1++){ for (n2=-1;n2 2;n2++){ for (q=-10;q 11;q++){ u1=u[s][n1+1][n2+1]; qx=q-n1+n2; pp=0; if (qx 10)pp=100; if (qx -10)pp=100; if (pp 50)qx=0; vs=-999; ns1=0; ns2=0; for (nx1=-1;nx1 2;nx1++){ for (nx2=-1;nx2 2;nx2++){ v1=u1+v[s-1][nx1+1][nx2+1][qx+10]; if (ww[s-1][nx1+1][nx2+1] u1)v1=-999; if (v1 vs)ns1=nx1; if (v1 vs)ns2=nx2; if (v1 vs)vs=v1; } } if (pp 50)vs=-999; gotoc[s][n1+1][n2+1][q+10]=ns1; gotoy[s][n1+1][n2+1][q+10]=ns2; gotoq[s][n1+1][n2+1][q+10]=qx; v[s][n1+1][n2+1][q+10]=vs; } } } } for (n1=-1;n1 2;n1++){ for (n2=-1;n2 2;n2++){ u1=u[100][n1+1][n2+1]; qx=n2-n1; vs=-999; ns1=0; ns2=0; for (nx1=-1;nx1 2;nx1++){ for (nx2=-1;nx2 2;nx2++){ v1=u1+v[99][nx1+1][nx2+1][qx+10]; if (ww[99][nx1+1][nx2+1] u1)v1=-999; if (v1 vs)ns1=nx1; if (v1 vs)ns2=nx2; if (v1 vs)vs=v1; } } endc[n1+1][n2+1]=ns1; endy[n1+1][n2+1]=ns2; endq[n1+1][n2+1]=qx; endv[n1+1][n2+1]=vs; } } maxv=-999; ns1=0; ns2=0; for (n1=-1;n1 2;n1++){ for (n2=-1;n2 2;n2++){ if (endv[n1+1][n2+1] maxv)ns1=n1; if (endv[n1+1][n2+1] maxv)ns2=n2; if (endv[n1+1][n2+1] maxv)maxv=endv[n1+1][n2+1]; } } opc[100]=ns1; opy[100]=ns2; opc[99]=endc[opc[100]+1][opy[100]+1]; opy[99]=endy[opc[100]+1][opy[100]+1]; opq[99]=endq[opc[100]+1][opy[100]+1]; for (j=1;j 99;j++){ s=99-j; opc[s]=gotoc[s+1][opc[s+1]+1][opy[s+1]+1][opq[s+1]+10]; opy[s]=gotoy[s+1][opc[s+1]+1][opy[s+1]+1][opq[s+1]+10]; opq[s]=gotoq[s+1][opc[s+1]+1][opy[s+1]+1][opq[s+1]+10]; } e=0; for (s=1;s 101;s++){ e=e+opc[s]*opc[s]+opy[s]*opy[s]; } for (s=1;s 101;s++){ c[s]=c[s]+opc[s]*h; y[s]=y[s]+opy[s]*h; } if (e 2)h=h/2; if (h 0.0001)t=10000; t=t+1; } for (s=1;s 95;s++){ dy=y[s+1]-y[s]; dc=c[s+1]-c[s]; if (dy 0)System.out.println(1-dc/dy); } } static double ux(double c1,double l1){ double up; double c3; double l3; int pp; pp=0; c3=c1; l3=l1; if (c3 0)pp=100; if (l3 0)pp=100; if (l3 1)pp=100; if (pp 50)c3=0.5; if (pp 50)l3=0.5; up=Math.log(c3)+Math.log(1-l3); if (pp 50)up=-999; return up; } }
https://w.atwiki.jp/maichi/pages/16.html
現在作成中
https://w.atwiki.jp/hikotaro_wiki/pages/12.html
統合開発環境eclipse テストjUnit QuickJUnit WebフーレムワークSpringBoot トップページへ戻る
https://w.atwiki.jp/kameda/pages/6.html
https://w.atwiki.jp/cappu/pages/70.html
参考 http //kenai.com/projects/jruby/pages/RedBridge require と クラスパス JRubyの require の検索は Javaのクラスパスを用いる require erb とある場合は、Javaのクラスパスのデフォルトパッケージ内に、erb.rb が含まれていれば良い。 require com/xxx/mylib とある場合は、Javaのクラスパスのcom.xxxパッケージ内に、mylib.rb が含まれていれば良い。 サンプル public static void main(String[] args) throws FileNotFoundException { scriptHelloWorld(); scriptHelloWorld2(); scriptHelloWorldFromFile(); } private static void scriptHelloWorld() { ScriptingContainer container = new ScriptingContainer(); container.runScriptlet("puts \"Hello World!\""); } private static void scriptHelloWorld2() { ScriptingContainer container = new ScriptingContainer(LocalContextScope.SINGLETHREAD, LocalVariableBehavior.PERSISTENT); container.runScriptlet("word = hello JRuby! "); container.runScriptlet("puts word"); } private static void scriptHelloWorldFromFile() throws FileNotFoundException { ScriptingContainer container = new ScriptingContainer(); container.runScriptlet(new FileInputStream(new File("helloworld.rb")), ""); } #配列 array = Array.new #ハッシュ hash = Hash.new hash[ a ] = A # A が表示される puts hash[ a ]
https://w.atwiki.jp/ce00582/pages/3848.html
import com.sun.j3d.utils.geometry.*; import com.sun.j3d.utils.universe.*; import javax.media.j3d.*; import javax.vecmath.*; public class game0822{ Color3f lightc; Vector3f lightd; DirectionalLight light; BranchGroup group; game0822(){ SimpleUniverse univ = new SimpleUniverse(); group = new BranchGroup(); group.addChild(new ColorCube(0.3)); light3d(); univ.getViewingPlatform().setNominalViewingTransform(); univ.addBranchGraph(group); } public static void main( String[] args ) { new game0822(); } void light3d(){ lightc = new Color3f(1.8f, 0.1f, 0.1f); BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0); lightd = new Vector3f(4.0f, -7.0f, -12.0f); light= new DirectionalLight(lightc, lightd); light.setInfluencingBounds(bounds); group.addChild(light); } }
https://w.atwiki.jp/nina_a/pages/65.html
変換 このページを編集 文字列 -- 各種オブジェクトの変換 バイト列 バイト列 - 文字列 byte[] str_bytes = new byte[]{0x41, 0x42, 0x43}; // ABC String str = new String(str_bytes); 符号化方法を指定する場合 byte[] str_bytes = new byte[]{0x41, 0x42, 0x43}; // ABC String str = new String(str_bytes, "UTF-8"); 文字列 - バイト列 String str = "ABC"; byte[] str_bytes = str.getBytes(); 符号化方法を指定する場合 String str = "ABC"; byte[] str_bytes = str.getBytes("UTF-8"); バイト列 - 16進数表現文字列 public String bytes2hexString(byte[] array) { if(array == null) throw new IllegalArgumentException(new NullPointerException()); char[] c=new char[array.length*2]; int tmp; for(int y=0, x=-1; y array.length; ++y) { tmp = (array[y] 4) 0x0F; c[++x]=(char)(tmp 9 ? tmp+ A -10 tmp+ 0 ); tmp = array[y] 0x0F; c[++x]=(char)(tmp 9 ? tmp+ A -10 tmp+ 0 ); } return new String(c); } 16進数表現文字列 - バイト列 public byte[] hexString2bytes(String hex) { if(hex == null) throw new IllegalArgumentException(new NullPointerException()); if(hex.startsWith("0x")) hex = hex.substring(2); if(hex.length()%2 != 0) hex = "0" + hex; hex = hex.toUpperCase(); byte[] b = new byte[hex.length()/2]; char[] c = hex.toCharArray(); for(int x=0, y=-1; x b.length; ++x) { b[x] = (byte)( ((c[++y] 9 ? c[y] - A + 10 c[y]- 0 ) 4) + (c[++y] 9 ? c[y] - A + 10 c[y]- 0 ) ); } return b; } 名前 コメント Java
https://w.atwiki.jp/opcboardbox/pages/19.html
環境 Windows 7 (64bit) 内容 Java JDK 6 のマイナーバージョンが古かったので、マイナーバージョン分だけアップデートしようと思った。 そのとき、アンインストール→再インストールでよいのか、インストーラー使えば勝手に上書きバージョンアップされるのかがわからなかった。 結果から言えば、アンインストール→再インストールすればいい。 旧バージョンがあるまま、新バージョンをインストーラー使って入れたら、旧新両方PCに存在することになった。 勝手に上書きはされないらしい。 あとは環境変数を書き直せばok。 アンインストール方法 コントロールパネル→「プログラムのアンインストール」→「Java(TM) SE Development Kit6 Update **」と「Java(TM) 6 Update **」をアンインストール。 Javaのソースコードを入れてる場合は「プログラムのアンインストール」をしても残っている場合があるので、「C \Program Files\Java\jdk1.6.0_**」が残っているか確認をする。残っていればごみ箱へ。 環境変数の path や JAVA_HOME を修正。 これで完了だと思う。